package uutalk.netcloud.talk.base.util;

import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;

/**
 * Created by Administrator on 2017/10/10.
 */

public class ProgressDialogUtil {

    public ProgressDialogUtil(Context context){
        ProgressDialog dialog = new ProgressDialog(context);
        //设置进度条风格，风格为圆形，旋转的
        dialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
        //设置ProgressDialog 标题
        dialog.setTitle("进度对话框");
        //设置ProgressDialog 提示信息
        dialog.setMessage("圆形进度条");
        //设置ProgressDialog 标题图标
        dialog.setIcon(android.R.drawable.ic_dialog_map);
        //设置ProgressDialog 的一个Button
        dialog.setButton(AlertDialog.BUTTON_POSITIVE,"确定", new ProgressDialog.OnClickListener(){
            @Override
            public void onClick(DialogInterface dialog, int which) {
            }
        });
        dialog.setButton(AlertDialog.BUTTON_NEGATIVE,"取消", new ProgressDialog.OnClickListener(){
            @Override
            public void onClick(DialogInterface dialog, int which) {
            }
        });
        //设置ProgressDialog 的进度条是否不明确
        dialog.setIndeterminate(false);
        //设置ProgressDialog 是否可以按退回按键取消
        dialog.setCancelable(true);
        //显示
        dialog.show();
    }
}
